import request from '@/utils/request'

// 查询申请用车审批列表
export function listApply(query) {
  return request({
    url: '/gwc/apply/getApprovalVehicleList',
    method: 'get',
    params: query
  })
}

// 新增申请用车审批
export function addApply(data) {
  return request({
    url: '/gwc/apply',
    method: 'post',
    data: data
  })
}

// 用车审批（通过、不通过）
export function updateApply(data) {
  return request({
    url: '/gwc/apply',
    method: 'post',
    data: data
  })
}

// 删除申请用车审批
export function delApply(approvalId) {
  return request({
    url: '/gwc/apply/' + approvalId,
    method: 'delete'
  })
}

// 根据车辆id获取任务列表
export function getVehicleApplicationList(vehicleId) {
  return request({
    url: '/gwc/application/getVehicleApplicationList',
    method: 'get',
    params: {
      vehicleId
    }
  })
}


// 查询用车审批单
export function getApprovalbyApplyId(applyId) {
  return request({
    url: '/gwc/apply/getApprovalbyApplyId',
    method: 'get',
    params: {
      applyId
    }
  })
}
